import request from '@/utils/request'

// 查询设备列表
export function listMachine(query) {
  return request({
    url: '/equipment/machine/list',
    method: 'get',
    params: query
  })
}

// 查询设备详细
export function getMachine(machineId) {
  return request({
    url: '/equipment/machine/' + machineId,
    method: 'get'
  })
}

// 新增设备
export function addMachine(data) {
  return request({
    url: '/equipment/machine',
    method: 'post',
    data: data
  })
}

// 修改设备
export function updateMachine(data) {
  return request({
    url: '/equipment/machine',
    method: 'put',
    data: data
  })
}

// 删除设备
export function delMachine(machineIds) {
  return request({
    url: '/equipment/machine/' + machineIds,
    method: 'delete'
  })
}

// 修改绑定信息
export function updateSmallCold(data) {
  return request({
    url: '/equipment/machine/updateBigCold',
    method: 'put',
    data: data
  })
}

// 删除车辆信息
export function delBound(data) {
  return request({
    url: '/equipment/machine/delBound',
    method: 'put',
    data: data
  })
}

//查询车辆信息
export function listBigCold(query) {
  return request({
    url: '/equipment/machine/select',
    method: 'get',
    params: query
  })
}
// export function getBoundCold(query) {
//   return request({
//     url: '/storage/api/getSubAndMachine',
//     method: 'get',
//     params: query
//   })
// }

// export function getBoundCold(query) {
//   return request({
//     url: '/storage/api3/getColdAndMechine',
//     method: 'get',
//     params: query
//   })
// }

export function getTemList(id) {
  return request({
    url: '/equipment/machine/macTemPic?id=' + id,
    method: 'get',
  })
}


export function getBoundCold(query) {
  return request({
    url: '/storage/api3/getSubAndMachine',
    method: 'post',
    data: query
  })
}